<template>
    <a-button type="primary" :disabled="readonly" @click="ButtonClick">{{ option.icon }}{{ option.text }}</a-button>
</template>
<script setup>
import { ref, watch, watchEffect, inject } from 'vue';

const emit = defineEmits(['UpdateEvent', 'SetError']);

const props = defineProps({
    option: Object,
    Value: {},
});

const readonly = ref(false);
// const InputValue = ref();

watchEffect(() => {
    readonly.value = !!props.option.readonly
})


const RootEvent = inject('RootEvent');

const ButtonClick = () => {
    RootEvent(props.option.EventName, props.Value);
}



</script>
<style lang="less" scoped></style>